package com.service.Impl;

import com.mapper.DeptMapper;
import com.pojo.Dept;
import com.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    /**
     * 添加部门
     */
    public int addDept(Dept dept){
        return deptMapper.addDept(dept);
    }
    /**
     *  查询所有部门
     */
    public List<Dept> selectAllDept(){
        return  deptMapper.selectAllDept();
    }

    /**
     * 根据条件查询
     */
    public  List<Dept> selectDeptByCondition(Dept dept){
        return deptMapper.selectDeptByCondition(dept);
    }
    /**
     * 修改信息
     */
    public int updateDept(Dept dept){
        return  deptMapper.updateDept(dept);
    }
    /**
     * 删除信息
     */
    public int deleteDept(String deptName){
        return   deptMapper.deleteDept(deptName);
    }
}
